package com.mycat.tencent.test;

import com.mycat.entity.WxpayParam;
import com.mycat.tencent.entity.request.WxAppRefundParams;
import com.mycat.tencent.entity.request.WxUnifiedorderParams;
import com.mycat.tencent.entity.response.WxPrepayResponse;
import com.mycat.tencent.entity.response.WxRefundQueryResponse;
import com.mycat.tencent.entity.response.WxRefundResponse;
import com.mycat.tencent.server.WxPayService;
import com.mycat.tencent.server.WxRefundService;

/**
 * @desc 微信支付相关接口测试类，需要进行测试需要配置支付宝com.mycat.tencent.config.ConfigInfo相中关参数
 * @author roger
 * @date 2016年9月26日
 */
@SuppressWarnings("unused")
public class Main {

	public static void main(String[] args) {
		
		/************微信APP支付统一下单************/
      	/*try {
      		WxUnifiedorderParams wxUnifiedorderParams = new WxUnifiedorderParams();
      		wxUnifiedorderParams.setOut_trade_no("20160926103905185555"); // 商户订单号
      		wxUnifiedorderParams.setTotal_fee(1); // 总金额
      		wxUnifiedorderParams.setTrade_type("APP"); // 交易类型
      		// 统一下单返回数据      获取【预支付Id】
      		WxPrepayResponse response = WxPayService.getPrePayUnifiedorder(wxUnifiedorderParams,"aliApp");
      		System.out.println(response);
      		
      		// 发起支付参数
      		WxpayParam request = WxPayService.getPaymentParam(response,"APP");
      		System.out.println(request);
		} catch (Exception e) {
			e.printStackTrace();
		}*/
      	/************微信APP支付统一下单************/
		
		
		
		
		/************微信申请退款************/
		/*WxAppRefundParams refundParams = new WxAppRefundParams();
		refundParams.setOut_trade_no("20160926103905182411");
		refundParams.setOut_refund_no("201609261039051824111111");
		refundParams.setTotal_fee(1);
		refundParams.setRefund_fee(1);
		try {
			WxRefundResponse response = WxRefundService.applyRefund(refundParams);
			System.out.println(response);
		} catch (Exception e1) {
			e1.printStackTrace();
		}*/
		/************微信申请退款************/
		
		
		
		/************微信交易退款查询************/
		/*WxRefundQueryResponse response1;
		try {
			response1 = WxRefundService.refundQuery("56723683563463634234");
			System.out.print(response1);
		} catch (Exception e) {
			e.printStackTrace();
		}*/
		/************微信交易退款查询************/
	}

}
